{include file="index/head" /}
<form method="post" action="{:url('dels')}" id="listform">
	<div class="box">
		<div class="box-head">
			<ul class="search">			 
			  <li><span>搜索：</span></li>
			  <li><span>订单状态</span>
			   <select name="s_status" onchange="sycms.search('{:url('index')}')">
						<option value="">选择</option>
						<option value="0">待发货</option>
						<option value="1">已发货</option>
						<option value="2">已收货</option>
						<option value="3">已完成</option>
						<option value="4">已取消</option>
			   </select>
			  </li>
			  <li><span>支付状态</span>
			    <select name="s_paystate" onchange="sycms.search('{:url('index')}')">
			      <option value="">选择</option>
			      <option value="0">未支付</option>
			      <option value="1">已支付</option>
						  <option value="2">已退款</option>
			    </select>
			  </li>
			  <li>
					<li>
						<span>开始时间</span>
					 <input type="text" class="intxt icon-date" autocomplete="off" name="s_starttime" id="startTime">
					</li>
					<li>
						<span>结束时间</span>
					 <input type="text" class="intxt icon-date" autocomplete="off" name="s_endtime" id="endTime">
					</li>
					<li>
			  <span>关健字：</span>
			  <input type="text" class="intxt" style="width:300px;" autocomplete="off" name="s_title" placeholder="产品|手机号|呢称|订单号|价格|支付金额" />
			  </li>				
			  <li>
			  <button type="button" class="btn" onclick="sycms.search('{:url('index')}')"><i class="icon-search"></i> 搜索</button>
			  </li>
			</ul>
			<a href="javascript:history.go(0);" class="btn fr"><i class="icon-refresh"></i> 刷新</a>
		</div>
		<table class="table">
			<tr>
				<th width="100">ID</th>
				<th>订单编号</th>
				<th>产品名称</th>
				<th>客户呢称</th>
				<th>客户手机</th>
				<th>产品价格</th>
				<th>支付金额</th>
				<th>优惠金额</th>
				<th>订单状态</th>
				<th>支付状态</th>
				<th>支付时间</th>
				<th>退款时间</th>
				<th>创建时间</th>
				<th width="200">操作</th>
			</tr>
			{volist name="list" id="v"}
			<tr>
				<td><input type="checkbox" name="id[]" value="{$v.id}" />{$v.id}</td>
				<td>{$v.orderno}</td>
				<td>{$v.title}</td>
				<td>{$v.name}</td>
				<td>{$v.mobile}</td>
				<td>{$v.price}</td>
				<td>{$v.paymoney}</td>
				<td>{$v.couponmoney}</td>
				{php} $s = orderStatus($v['status']); {/php}
				<td>
					{if condition="$v.status eq 4"}
					<font color="{$s.color}">{$s.txt}</font>
					{else}
					{if condition="$v.paystate eq 0"}<font>待支付</font>{else}<font color="{$s.color}">{$s.txt}</font>{/if}
					{/if}
				</td>
				<td>{$v.paystate|_orderPaystate}</td>
				<td>{$v.paytime}</td>
				<td>{$v.refundtime}</td>
				<td>{$v.datetime}</td>
				<td>
					<a href="{:url('detail',['id'=>$v.id])}" class="btn"><i class="icon-eye"></i> 详情</a>
					<a href="javascript:void(0);" onclick="sycms.del('{:url('del',['id'=>$v.id])}')" class="btn red"><i class="icon-trash-o"></i>
						删除</a>
				</td>
			</tr>
			{/volist}
			<tr>
				<td colspan="14">
					<ul class="operat">
						<li class="li1"><input type="checkbox" onclick="sycms.allselect(this)" /> 全选</li>
						<li><a href="javascript:void(0);" onclick="sycms.delallSelect('{:url('dels')}')" class="btn red"><i class="icon-trash-o"></i>
								批量删除</a></li>
						<li><span>操作：</span>
							<select name="status" onchange="sycms.plattr('{:url('upStatus')}',this)">
								<option value="">修改订单状态</option>
								<option value="0">待发货</option>
								<option value="1">已发货</option>
								<option value="2">已收货</option>
								<option value="3">已完成</option>
								<option value="4">已取消</option>
							</select>
							<select name="paystate" onchange="sycms.plattr('{:url('upPaystate')}',this)">
								<option value="">修改支付状态</option>
								<option value="0">未支付</option>
								<option value="1">已支付</option>
								<option value="2">已退款</option>
							</select>
						</li>
					</ul>
				</td>
			</tr>
			<tr>
				<td colspan="14">
					<div class="page">{$page}</div>
				</td>
			</tr>
		</table>
	</div>
</form>
<script type="text/javascript">
	layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  laydate.render({elem: '#startTime',type: 'date',isInitValue:false});
			laydate.render({elem: '#endTime',type: 'date',isInitValue:false});
	});
</script>
